          
          
         
            //var originalWidth = consultWidth = window.innerWidth;
            //var linkJumpCount = 16;
            var linkHref;
            var beginningDelay = null;
            var animateDelayCount = 4000;
            //var watchBrowse = null;
            var sectnActive = 0;
            var scrollDown = '';
            var scrollStart = false;
            var secPrevent = false;
            var updateSecDelay = null;
            var updatePrevent = null;
            var updateUnActive = null;
            var scrollCertain = null;

            function countDown(){
                linkJumpCount -= 1;
               
                //linkJumpCount=0时，跳转页面
                if(linkJumpCount <= 0){
                    location.href = linkHref;
                }

                //每秒执行一次,showTime()
                setTimeout("countDown()",100);
            }
            //禁止滚动
            window.addEventListener('DOMMouseScroll', function (e) {
                if(window.innerWidth > 1024){
                    if(e.detail > 0){//向下滚动
                        console.log('//向下滚动');
                        scrollDown = true;
                        
                    }else{//向上滚动
                        console.log('//向上滚动');
                        scrollDown = false;
                    }
                    if(!$('.switch').length) return false;
                    custmzScroll();
                }
            })
            window.addEventListener('mousewheel', function (e) {
                if(window.innerWidth > 1024){
                    if(e.wheelDelta < 0){//向下滚动
                        scrollDown = true;
                    }else{//向上滚动
                        scrollDown = false;
                    }
                    if(!$('.switch').length) return false;
                    custmzScroll();
                }
            })
            //内容高度是否小于屏幕高度
            function checkContnHeight(){
                if($('.container')[0].offsetHeight < window.innerHeight){
                    $('.container').addClass('fillAll');
                }
            }
            //判断是否为移动设备
            function browserRedirect(){
                var sUserAgent = navigator.userAgent.toLowerCase();
                var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
                var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
                var bIsMidp = sUserAgent.match(/midp/i) == "midp";
                var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
                var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
                var bIsAndroid = sUserAgent.match(/android/i) == "android";
                var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
                var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
                if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
                    $('body').addClass('mobileDevice');
                    $('body').addClass('normal');
                    return true;
                }else{
                    return false;
                }
            }
            function GetQueryString(name) {  
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");  
                var r = window.location.search.substr(1).match(reg);  //获取url中"?"符后的字符串并正则匹配
                var context = "";  
                if (r != null)  
                     context = r[2];  
                reg = null;  
                r = null;  
                return context == null || context == "" || context == "undefined" ? "" : context;  
            }
            function custmzScroll(val){
                console.log(val);
                if(window.innerWidth <= 1024) return false;
                if(secPrevent) return false;
                if(((scrollDown && sectnActive == $('.switch').length - 1) || (!scrollDown && sectnActive == 0)) && val == undefined && !$('.switch.projects.active .contn .swiper.on').length) return false;
                if($('.switch.active').length && !$('.switch.projects.active .contn .swiper.on').length){
                    clearTimeout(updateSecDelay);
                    clearTimeout(updateUnActive);
                    $('.switch:eq(' + sectnActive + ')').addClass('away leave');
                    updateSecDelay = setTimeout(function(){
                        for(var u = 0;u < $('.switch.leave').length;u++){
                            $('.switch.leave:eq(' + u + ')').removeClass('active');
                        }
                        
                    },510)
                    updateUnActive = setTimeout(function(){
                        for(var u = 0;u < $('.switch').length;u++){
                            if($('.switch')[u].className.indexOf('leave') >= 0){
                                $('.switch:eq(' + u + ')').removeClass('away');
                                $('.switch:eq(' + u + ')').removeClass('leave');
                            }
                        }
                    },1210)
                }
                if($('.switch.projects.active .contn .swiper.on').length){
                    if(scrollDown){
                        prjctSwiper.slideNext();
                    }else{
                        prjctSwiper.slidePrev();
                    }
                    return false;
                }
                if(val != undefined){
                    sectnActive = val;
                }else{
                    if(scrollDown){
                        sectnActive++;
                    }else{
                        sectnActive--;
                    }
                }
                $('section').removeClass('current');
                $('section:eq(' + sectnActive + ')').addClass('current');
                $('.btmLft .loc ul li').removeClass('clicked');
                $('.btmLft .loc ul li:eq(' + sectnActive + ')').addClass('clicked');
                $('.btmLft .loc .atPresent')[0].innerText = '0' + (sectnActive + 1);
                if(sectnActive != 0){
                    $('footer').addClass('c');
                    $('header .logo').addClass('c');
                    $('.btmLft').addClass('appear');
                }else{
                    $('footer').removeClass('c');
                    $('header .logo').removeClass('c');
                    $('.btmLft').removeClass('appear');
                }
                if(sectnActive == $('.switch').length - 1){
                    $('.btmLft .sNext').addClass('hidden');
                }else{
                    $('.btmLft .sNext').removeClass('hidden');
                }
                //if(sectnActive == $('.switch').length || sectnActive == -1) return false;
                clearTimeout(updatePrevent);
                secPrevent = true;
                $('.switch:eq(' + sectnActive + ')').addClass('active');
                if($('.switch:eq(' + sectnActive + ')')[0].className.indexOf('hideLoc') >= 0){
                    $('footer + .btmLft .loc').addClass('hidden');
                }else{
                    $('footer + .btmLft .loc').removeClass('hidden');
                }
                updatePrevent = setTimeout(function(){
                    secPrevent = false;
                },2210);
            }
            function scrollToCertain(ele){
                console.log(ele[0].getBoundingClientRect().top);
                var scrollVal = ele[0].offsetTop;
                scrollCertain = setInterval(function(){
                    var scrollTop = parseInt(document.documentElement.scrollTop || document.body.scrollTop);
                    var val = Math.ceil((scrollVal - scrollTop) / 15);
                    if(scrollTop >= scrollVal){
                        document.documentElement.scrollTop = document.body.scrollTop = scrollVal;
                        clearInterval(scrollCertain);
                    }else{
                        document.documentElement.scrollTop = document.body.scrollTop = (scrollTop + val);
                        console.log(scrollTop)
                        if(scrollTop == document.documentElement.scrollHeight - window.innerHeight){
                            clearInterval(scrollCertain);
                        }
                    }
                },10)
            }

            $(document).ready(function(){
                    browserRedirect(); 
                    setTimeout(checkContnHeight,10);
                    if(GetQueryString('scrlInd')){
                        custmzScroll(Number(GetQueryString('scrlInd')));
                    }
                    $('section:eq(0)').addClass('current active');
                    $('.btmLft .loc ul li:eq(' + sectnActive + ')').addClass('clicked')
                    $('header .menuBtn').click(function(){
                        if($(this).parent()[0].className.indexOf('clicked') >= 0){
                            if($('.mobileDevice').length){
                                //document.body.removeEventListener("touchmove", bodyScroll, {passive:false});
                            }else{
                                $('body').removeClass('noScroll');
                            }
                            $(this).parent().removeClass('clicked');
                        }else{
                            if($('.mobileDevice').length){
                                //document.body.addEventListener("touchmove", bodyScroll, {passive:false});
                            }else{
                                $('body').addClass('noScroll');
                            }
                            $(this).parent().addClass('clicked');
                        }
                    })
                    for(var n = 0;n < $('header .menu ul li').length;n++){
                        var dataNo = '0' + (n + 1);
                        $('header .menu ul li .ttl:eq(' + n + ')').attr('data-no',dataNo);
                        $('header .menu ul li .box:has(p) .ttl').addClass('f');
                    }
                    $('header .menu ul li').mouseenter(function(){
                        $(this).addClass('hover');
                        if($(this).find('.sonMenu').length){
                            var height = 0;
                            for(var a = 0; a < $(this).find('.sonMenu a').length;a++){
                                height += $(this).find('.sonMenu a')[a].offsetHeight;
                            }
                            $(this).find('.sonMenu').height(height);
                        }
                    })
                    $('header .menu ul li').mouseleave(function(){
                        $(this).removeClass('hover');
                        $(this).find('.sonMenu').height(0);
                    })

                    $('.btmLft .loc ul li').click(function(){
                        var ind = $(this).index();
                        if(ind == sectnActive) return false;
                        secPrevent = false;
                        custmzScroll(ind);
                        $('.btmLft .loc ul li').removeClass('clicked');
                        $(this).addClass('clicked');
                    })
                    $('.sNext').click(function(){
                        secPrevent = false;
                        scrollDown = true;
                        custmzScroll();
                        if($(this).parents('.cutPics').length && window.innerWidth <= 1024){
                            scrollToCertain($(this).parents('.cutPics').next());
                        }
                    })
                    
                    /*$('a').click(function(e){
                        
                            linkHref = $(this).attr('href');
                            e = e || window.event;
                            e.cancelBubble = true;
                            e.stopPropagation();
                            if(e.preventDefault){ // w3c
                                e.preventDefault();
                            } else { // ie
                                e.returnValue = false;
                            }
                            countDown();
                            $('.leaving').addClass('jump');
                            $('.container').addClass('jump');
                    })*/
                    
            })
            //$(document).on('mousewheel DOMMouseScroll', onMouseScroll);

            

        